<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../其他/js/react.development.js"></script>
  <script src="../其他/js/react-dom.development.js"></script>

  <!-- Don't use this in production: -->
  <script src="../其他/js/babel.min.js"></script>
</head>
<body>
  <div id="root"></div>
  <script type="text/babel">
    class Weather extends React.Component {
      constructor(props) {
        super(props)
        this.state = {isHot: false}
        this.changeWeather = this.changeWeather.bind(this)
      }
      render() {
        const {isHot} = this.state
        return <span onClick={this.changeWeather}>今天天气真{isHot? '炎热':'凉爽'}</span>
      }
      changeWeather() {
        const isHot = this.state.isHot
        this.setState({isHot:!isHot})
      }
    }
    ReactDOM.render(<Weather/>, document.getElementById('root'))

  </script>
  
</body>
</html>